﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using University.Workshop.Presenters;
using University.Workshop.Business;
using University.Workshop.Model;
using System.Collections.ObjectModel;

namespace University.Workshop.Tests
{
    public class RentMock : IRent
    {
        #region IMember Rent
        public string RentCode
        {
            get;
            set;
        }

        public string UserCode
        {
            get;
            set;
        }

        public DateTime DateRent
        {
            get;
            set;
        }

        public string Concept
        {
            get;
            set;
        }

        public string Category
        {
            get;
            set;
        }

        public string TotalAmount
        {
            get;
            set;
        }

        public Collection<RentDetail> ListOfAmounts
        {
            get;
            set;
        }

        public string Amount
        {
            get;
            set;
        }

        public string Note
        {
            get;
            set;
        }
        #endregion

        #region RentCases

        internal void AddAnAmountToListGood()
        {
            Amount = "189";
            Note = "Factura del mes de enero 2010";
        }

        #endregion

        internal void AddAnAmountToListWithOutAnAmount()
        {
            Amount = string.Empty;
            Note = "note 1";
        }

        internal void AddAnAmountToListWithOutANote()
        {
            Amount = "345";
            Note = string.Empty;
        }

        internal void GetRentCode()
        {
            Amount = "345";
        }

        internal void RegisterRent()
        {
            RentCode = RentController.GetRentCode();
            UserCode = "1";
            DateRent = DateTime.Parse("10-May-11 10:30:54 PM");
            Concept = "Concept " + RentCode;
            Category = "Agua";
            TotalAmount = "100";
            RentDetail rentDetail = new RentDetail();
            rentDetail.CodeRent=RentCode;
            rentDetail.Amount = 100;
            rentDetail.Note = "Segunda factura del mes de mayo 2011";
            ListOfAmounts = new Collection<RentDetail>();
            ListOfAmounts.Add(rentDetail);
        }

        internal void RegisterRentFailConcept()
        {
            RentCode = RentController.GetRentCode();
            UserCode = "1";
            DateRent = DateTime.Parse("10-May-11 10:30:54 PM");
            Concept = string.Empty;
            Category = "Agua";
            TotalAmount = "100";
            RentDetail rentDetail = new RentDetail();
            rentDetail.CodeRent = RentCode;
            rentDetail.Amount = 100;
            rentDetail.Note = "Segunda factura del mes de mayo 2011";
            ListOfAmounts = new Collection<RentDetail>();
            ListOfAmounts.Add(rentDetail);
        }

        internal void RegisterRentFailAmounts()
        {
            RentCode = RentController.GetRentCode();
            UserCode = "1";
            DateRent = DateTime.Parse("10-May-11 10:30:54 PM");
            Concept = "Concept " + RentCode;
            Category = "Agua";
            TotalAmount = "0";
        }
    }
}
